/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package sistcomptf;

import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Image;
import javax.swing.ImageIcon;
import javax.swing.JPanel;

/**
 *
 * @author Medina
 */
class BackgroundPanel extends JPanel
{
  Image image;
  String imgPath= null;
  public BackgroundPanel()
  {
      this.setSize(100, 100);

  }

  public void setImageBck(String imgPath){
      this.imgPath = imgPath;
  }
  @Override
  protected void paintComponent(Graphics g)
  {Dimension tamanio = getSize();
    ImageIcon imagen = new ImageIcon(getClass().getResource(imgPath));

    g.drawImage(imagen.getImage(),0,0,tamanio.width, tamanio.height,null);
    setOpaque(false);
    super.paintComponent(g); 
  }
}

